home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1995 / MacHack 1995.toast / Presentations / Presentations ’91 / MPW Stand-Alone Libraries / CPlusXCMD.cp < prev    next >
Text File  |  1991-06-13  |  1KB  |  75 lines

  1. #include "CPlusXCMD.h"
  2.  
  3. #pragma segment MAIN
  4.  
  5. TDig myObj1;
  6.  
  7. pascal void
  8. Main(XCmdPtr paramPtr)
  9. {    
  10.     StringHandle ResultString = StringHandle(NewHandle(256));
  11.     if (ResultString != 0L)
  12.     { 
  13.         char temps[256];
  14.         myObj1.GetDaveAndAllan(temps);
  15.         BlockMove(temps, Ptr(*ResultString), strlen(temps)+1);
  16.         paramPtr->returnValue = Handle(ResultString);
  17.     };
  18. }
  19.  
  20. TDittle::TDittle()
  21. {
  22.     DebugStr("\pTDittle::TDittle");
  23.     dave << "Evad";
  24. }
  25.  
  26. TDittle::~TDittle()
  27. {
  28.     DebugStr("\pTDittle::~TDittle");
  29.     dave << "";
  30. }
  31.  
  32. char * TDittle::GetDave(void)
  33. {
  34.     DebugStr("\pTDittle::GetAllan");
  35.     return(dave.str());
  36. }
  37.  
  38.  
  39. TDig::TDig()
  40. {
  41.     DebugStr("\pTDig::TDig");
  42.     allan << "Allan";
  43. }
  44.  
  45. TDig::~TDig()
  46. {
  47.     DebugStr("\pTDig::~TDig");
  48.     allan << "";
  49. }
  50.  
  51. char * TDig::GetDave(void)
  52. {
  53.     DebugStr("\pTDig::GetDave");
  54.     strstream s;
  55.     s << "Dave";
  56.     return(s.str());
  57. }
  58.  
  59.  
  60. char * TDig::GetAllan(void)
  61. {
  62.     DebugStr("\pTDig::GetAllan");
  63.     return(allan.str());
  64. }
  65.  
  66.  
  67. char * TDig::GetDaveAndAllan(char * astr)
  68. {
  69.     DebugStr("\pTDig::GetDaveAndAllan");
  70.     strstream scratch;
  71.     scratch << GetDave() << " & " << GetAllan();
  72.     strcpy(astr, scratch.str());
  73.     return(astr);
  74. }
  75.